package com.eds.feign;

import com.eds.pojo.BaseResult;
import com.pojo.Orders;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName：OrderFeign
 * @Author: vvSmile
 * @Date: 2025/04/01
 * @Description: 必须描述类做什么事情, 实现什么功能
 */
@FeignClient("eds-frontend-orders")
public interface OrderFeign {
    //创建订单
    @PostMapping("/ordersController/createOrders")
    Boolean createOrder(@RequestBody Orders orders);

    @GetMapping("/ordersController/selectOrdersByOrdersId")
    BaseResult selectOrdersByOrdersId(@RequestParam("ordersId") String ordersId);

    @GetMapping("/ordersController/cancelOrders")
    BaseResult cancelOrders(@RequestParam("ordersId") String ordersId);

    //根据课程时间和用户id和课程id查询订单
    @GetMapping("/ordersController/selectOrdersByScheduleUserCourseId")
    Orders selectOrdersByScheduleUserCourseId(@RequestParam("scheduleId") Long scheduleId, @RequestParam("userId") Long userId, @RequestParam("courseId") Long courseId);


}
